import { reqHospitalsetParamsList, resHospitalsetResultData, AddHospitalsetParamsBodyData, resHospitalsetOneData } from './model/hospitalsetType';
//这个文件的作用是为了定义接口请求函数
//导入请求文件
import { request } from "@/utils/http";

//导出接口函数
//请求所有医院设置的数据
//这个请求的接口函数是需要被组件所导入
export const GetAllHospitalSetListData = ({ page, limit, hosname, hoscode }: reqHospitalsetParamsList) => {
    return request.get<any, resHospitalsetResultData>(`/admin/hosp/hospitalSet/${page}/${limit}`, {
        //请求字符串
        params: {
            hosname,
            hoscode
        }
    });
}


//添加医院设置
export const AddHospitalSetBody = (reqBody: AddHospitalsetParamsBodyData) => {
    return request.post<any, null>('/admin/hosp/hospitalSet/save', reqBody);
}

//删除单条医院设置
export const deleteOneHospitalSet = (id: number) => {
    return request.delete<any, null>(`/admin/hosp/hospitalSet/remove/${id}`);
}

//获取单条医院设置数据
export const getOneHospitalSet = (id: string) => {
    return request.get<any, resHospitalsetOneData>(`/admin/hosp/hospitalSet/get/${id}`);
}

//修改单条医院设置
export const ModifyHospitalSetBody = (reqBody: AddHospitalsetParamsBodyData) => {
    return request.put<any, null>('/admin/hosp/hospitalSet/update', reqBody);
}

//批量删除医院设置
export const deleteAllHospitalSet = (ids: React.Key[]) => {
    return request.delete<any, null>('/admin/hosp/hospitalSet/batchRemove', {
        data: ids  // [274680,274678]
    })
}

